<!DOCTYPE HTML>
<html>
<head>
<title>DriveSpaceFree | AutoHotkey v1</title>
<meta name="description" content="The DriveSpaceFree command retrieves the free disk space of the drive which contains the specified path, in megabytes." />
<meta name="ahk:equiv-v2" content="lib/DriveGetSpaceFree.htm" />
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
</head>
<body>

<h1>DriveSpaceFree</h1>

<p>包含指定路径的驱动器的可用磁盘空间, 单位为 MB.</p>

<pre class="Syntax"><span class="func">DriveSpaceFree</span>, OutputVar, Path</pre>
<h2 id="Parameters">参数</h2>
<dl>

  <dt>OutputVar</dt>
  <dd><p>用来保存结果的输出变量, 结果向下取整到最近的整数.</p></dd>

  <dt>Path</dt>
  <dd><p>驱动器包含的任何路径(可能也适用于 UNC 路径和映射驱动器).</p></dd>

</dl>

<h2 id="Remarks">备注</h2>
<p><em>OutputVar</em> 被设置为可用的磁盘空间数, 单位为 MB(向下取整到最近的兆字节).</p>
<p>一般来说, <em>Path</em> 可以是任何路径. 由于 NTFS 支持挂载的卷和目录连接, 具有相同驱动器号的不同路径可以产生不同数量的空闲空间.</p>

<h2 id="Related">相关</h2>
<p><a href="Drive.htm">Drive</a>, <a href="DriveGet.htm">DriveGet</a></p>
<h2 id="Examples">示例</h2>
<div class="ex" id="ExBasic">
<p><a class="ex_number" href="#ExBasic"></a> 检索 C 盘的可用磁盘空间, 并将其存储在 <em>FreeSpace</em> 中.</p>
<pre>DriveSpaceFree, FreeSpace, c:\</pre>
</div>
<div class="ex" id="ExPath">
<p><a class="ex_number" href="#ExPath"></a> 检索并报告包含 <a href="../Variables.htm#MyDocuments">A_MyDocuments</a> 的驱动器的空闲磁盘空间.</p>
<pre>DriveSpaceFree, FreeSpace, % A_MyDocuments
MsgBox % FreeSpace " MB"</pre>
</div>

</body>
</html>